<template>
    <div class="transfer-container">
        
      <!-- <div ref="chart" style="height: 21vh; width: 100%"></div> -->
        <div class="page-header">
            <router-link class="back-link" to="/main/renshi">
                <i class="el-icon-arrow-left"></i>
                返回
            </router-link>
            <h1>人事调动</h1>
        </div>

        <div class="content-wrapper">
            <div class="section-header">
                <div class="section-title">
                    <i class="el-icon-refresh"></i>
                    <span>人事调动管理</span>
                </div>
                <div class="section-desc">员工状态变动与调动管理</div>
            </div>

            <!-- 员工状态变动 -->
            <div class="category-section">
                <div class="category-header">
                    <i class="el-icon-user"></i>
                    <h3>员工状态变动</h3>
                </div>
                <div class="link-grid">
                    <router-link class="action-card" to="/main/renshi/renshidiaodong/zhuanzheng/zhuanzheng">
                        <div class="card-icon">
                            <i class="el-icon-check"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">员工转正</span>
                            <span class="card-desc">试用期员工转正管理</span>
                        </div>
                    </router-link>
                    <router-link class="action-card" to="/main/renshi/renshizhidu/neibudiaodong/neibudiaodong">
                        <div class="card-icon">
                            <i class="el-icon-share"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">员工内部调动审批</span>
                            <span class="card-desc">部门岗位调动管理</span>
                        </div>
                    </router-link>
                    <router-link class="action-card" to="/main/renshi/renshidiaodong/yuangonglizhi/yuangonglizhi">
                        <div class="card-icon">
                            <i class="el-icon-switch-button"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">员工离职</span>
                            <span class="card-desc">员工离职办理管理</span>
                        </div>
                    </router-link>
                    <!-- <router-link class="action-card" to="/main/renshi/renshidiaodong/yuangongxiuzhi/yuangongxiuzhi"> -->
                    <router-link class="action-card" :to="{ name: 'Yuangongxiuzhi' }">
                        <div class="card-icon">
                            <i class="el-icon-time"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">员工休职</span>
                            <span class="card-desc">员工休职申请管理</span>
                        </div>
                    </router-link>
                    <router-link class="action-card" :to="{ name: 'Yuangongfuzhi' }">
                        <div class="card-icon">
                            <i class="el-icon-refresh-right"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">员工复职</span>
                            <span class="card-desc">员工复职申请管理</span>
                        </div>
                    </router-link>
                </div>
            </div>

            <!-- 报表与设置 -->
            <div class="category-section">
                <div class="category-header">
                    <i class="el-icon-setting"></i>
                    <h3>报表与设置</h3>
                </div>
                <div class="link-grid">
                    <router-link class="action-card" to="/main/renshi/renshidiaodong">
                        <div class="card-icon">
                            <i class="el-icon-data-analysis"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">离职率报表</span>
                            <span class="card-desc">员工离职数据分析</span>
                        </div>
                    </router-link>
                    <router-link class="action-card" to="/main/renshi/renshidiaodong">
                        <div class="card-icon">
                            <i class="el-icon-set-up"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">转正设置</span>
                            <span class="card-desc">转正流程配置</span>
                        </div>
                    </router-link>
                    <router-link class="action-card" to="/main/renshi/renshidiaodong">
                        <div class="card-icon">
                            <i class="el-icon-set-up"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">调动设置</span>
                            <span class="card-desc">调动流程配置</span>
                        </div>
                    </router-link>
                    <router-link class="action-card" to="/main/renshi/renshidiaodong">
                        <div class="card-icon">
                            <i class="el-icon-set-up"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">离职设置</span>
                            <span class="card-desc">离职流程配置</span>
                        </div>
                    </router-link>
                    <router-link class="action-card" to="/main/renshi/renshidiaodong">
                        <div class="card-icon">
                            <i class="el-icon-set-up"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">休职设置</span>
                            <span class="card-desc">休职流程配置</span>
                        </div>
                    </router-link>
                    <router-link class="action-card" to="/main/renshi/renshidiaodong">
                        <div class="card-icon">
                            <i class="el-icon-set-up"></i>
                        </div>
                        <div class="card-content">
                            <span class="card-title">复职设置</span>
                            <span class="card-desc">复职流程配置</span>
                        </div>
                    </router-link>
                </div>
            </div>
        </div>
    </div>
</template>
<!-- <script>
export default {
  mounted() {
    this.checkScrollbar();
    window.addEventListener('resize', this.checkScrollbar);
  },
  beforeDestroy() {
    window.removeEventListener('resize', this.checkScrollbar);
  },
  methods: {
    checkScrollbar() {
      const div = this.$refs.chart;
      if (document.body.scrollHeight > window.innerHeight) {
        div.style.display = 'none';
      } else {
        div.style.display = 'block';
      }
    }
  }
}
</script> -->
<style lang="scss" scoped>
.transfer-container {
    min-height: 100vh;
    // background-color: #f5f7fa;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .page-header {
        display: flex;
        align-items: center;
        margin-bottom: 24px;
        background-color: #fff;
        padding: 16px 24px;
        border-radius: 8px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
        width: 800px;
        margin: 0px auto 25px auto;

        .back-link {
            display: flex;
            align-items: center;
            text-decoration: none;
            color: #409EFF;
            font-size: 14px;
            margin-right: 20px;
            transition: all 0.3s;

            i {
                margin-right: 5px;
            }

            &:hover {
                opacity: 0.8;
            }
        }

        h1 {
            margin: 0;
            font-size: 20px;
            font-weight: 500;
            color: #303133;
        }
    }

    .content-wrapper {
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 6px 6px rgba(0, 0, 0, 0.1);
        padding: 24px;
        width: 800px;
        margin: 0px auto 0px auto;

        .section-header {
            text-align: center;
            margin-bottom: 40px;

            .section-title {
                display: inline-flex;
                align-items: center;
                background: linear-gradient(135deg, #409EFF, #66b1ff);
                color: white;
                padding: 12px 24px;
                border-radius: 10px;
                margin-bottom: 16px;
                box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2);

                i {
                    margin-right: 8px;
                    font-size: 20px;
                }

                span {
                    font-size: 20px;
                    font-weight: 500;
                }
            }

            .section-desc {
                color: #909399;
                font-size: 18px;
            }
        }

        .category-section {
            margin-bottom: 40px;

            &:last-child {
                margin-bottom: 0;
            }

            .category-header {
                display: flex;
                align-items: center;
                justify-content: center;
                margin-bottom: 20px;
                padding-bottom: 12px;
                border-bottom: 1px solid #ebeef5;

                i {
                    font-size: 20px;
                    color: #409EFF;
                    margin-right: 8px;
                }

                h3 {
                    margin: 0;
                    font-size: 18px;
                    font-weight: 500;
                    color: #303133;
                }
            }

            .link-grid {
                display: grid;

                grid-template-columns: repeat(3, 1fr);
                width: 800px;
                margin: 0px auto;
                gap: 20px;

                .action-card {
                    display: flex;
                    align-items: center;
                    text-decoration: none;
                    background: #f5f7fa;
                    border: 1px solid #ebeef5;
                    border-radius: 8px;
                    padding: 16px;
                    transition: all 0.3s ease;

                    &:hover {
                        transform: translateY(-3px);
                        background: #ecf5ff;
                        border-color: #409EFF;
                        box-shadow: 0 4px 12px rgba(64, 158, 255, 0.1);

                        .card-icon {
                            background: #409EFF;

                            i {
                                color: white;
                            }
                        }

                        .card-content {
                            .card-title {
                                color: #409EFF;
                            }
                        }
                    }

                    .card-icon {
                        width: 40px;
                        height: 40px;
                        border-radius: 8px;
                        background: #ebeef5;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        margin-right: 12px;
                        transition: all 0.3s ease;

                        i {
                            font-size: 20px;
                            color: #909399;
                        }
                    }

                    .card-content {
                        flex: 1;

                        .card-title {
                            display: block;
                            font-size: 16px;
                            font-weight: 500;
                            color: #303133;
                            margin-bottom: 4px;
                        }

                        .card-desc {
                            display: block;
                            font-size: 14px;
                            color: #909399;
                        }
                    }
                }
            }
        }
    }
}

@media screen and (max-width: 768px) {
    .transfer-container {
        padding: 12px;

        .page-header {
            padding: 12px 16px;
        }

        .content-wrapper {
            padding: 20px 16px;

            .section-header {
                margin-bottom: 24px;

                .section-title {
                    padding: 8px 16px;

                    i {
                        font-size: 18px;
                    }

                    span {
                        font-size: 16px;
                    }
                }
            }

            .category-section {
                margin-bottom: 24px;

                .category-header {
                    margin-bottom: 16px;
                    padding-bottom: 8px;

                    i {
                        font-size: 18px;
                    }

                    h3 {
                        font-size: 14px;
                    }
                }

                .link-grid {
                    grid-template-columns: 1fr;
                    gap: 12px;

                    .action-card {
                        padding: 12px;

                        .card-icon {
                            width: 32px;
                            height: 32px;

                            i {
                                font-size: 16px;
                            }
                        }

                        .card-content {
                            .card-title {
                                font-size: 13px;
                            }

                            .card-desc {
                                font-size: 11px;
                            }
                        }
                    }
                }
            }
        }
    }
}
</style>